package top.yunmouren.areamusic.commannd;

import top.yunmouren.areamusic.config.AreaDto;
import top.yunmouren.areamusic.config.Priority;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class PlayerSelectionCache {
    private final Map<String, CreateAreaDto> playerCommandHistory = new HashMap();

    public PlayerSelectionCache() {
    }

    public CreateAreaDto getPlayerHistory(String uuid) {
        return (CreateAreaDto)this.playerCommandHistory.get(uuid);
    }

    public CreateAreaDto setPlayerHistory(String uuid, CreateAreaDto playerHistory) {
        if (playerHistory == null) {
            this.playerCommandHistory.remove(uuid);
            return null;
        } else {
            this.playerCommandHistory.put(uuid, playerHistory);
            return playerHistory;
        }
    }

    public static class CreateAreaDto {
        private String areaId;
        private String world;
        private List<String> musicId;
        private Priority priority;
        private Boolean random;
        private Boolean loop;
        private Boolean enabled;
        private Boolean overWrite;
        private Float volume;
        private Float pitch;
        private AreaDto.Point minPoint;
        private AreaDto.Point maxPoint;

        public static CreateAreaDto.CreateAreaDtoBuilder builder() {
            return new CreateAreaDto.CreateAreaDtoBuilder();
        }

        public String getAreaId() {
            return this.areaId;
        }

        public String getWorld() {
            return this.world;
        }

        public List<String> getMusicId() {
            return this.musicId;
        }

        public Priority getPriority() {
            return this.priority;
        }

        public Boolean getRandom() {
            return this.random;
        }

        public Boolean getLoop() {
            return this.loop;
        }

        public Boolean getEnabled() {
            return this.enabled;
        }

        public Boolean getOverWrite() {
            return this.overWrite;
        }

        public Float getVolume() {
            return this.volume;
        }

        public Float getPitch() {
            return this.pitch;
        }

        public AreaDto.Point getMinPoint() {
            return this.minPoint;
        }

        public AreaDto.Point getMaxPoint() {
            return this.maxPoint;
        }

        public void setAreaId(String areaId) {
            this.areaId = areaId;
        }

        public void setWorld(String world) {
            this.world = world;
        }

        public void setMusicId(List<String> musicId) {
            this.musicId = musicId;
        }

        public void setPriority(Priority priority) {
            this.priority = priority;
        }

        public void setRandom(Boolean random) {
            this.random = random;
        }

        public void setLoop(Boolean loop) {
            this.loop = loop;
        }

        public void setEnabled(Boolean enabled) {
            this.enabled = enabled;
        }

        public void setOverWrite(Boolean overWrite) {
            this.overWrite = overWrite;
        }

        public void setVolume(Float volume) {
            this.volume = volume;
        }

        public void setPitch(Float pitch) {
            this.pitch = pitch;
        }

        public void setMinPoint(AreaDto.Point minPoint) {
            this.minPoint = minPoint;
        }

        public void setMaxPoint(AreaDto.Point maxPoint) {
            this.maxPoint = maxPoint;
        }

        public boolean equals(Object o) {
            if (o == this) {
                return true;
            } else if (!(o instanceof CreateAreaDto)) {
                return false;
            } else {
                CreateAreaDto other = (CreateAreaDto)o;
                if (!other.canEqual(this)) {
                    return false;
                } else {
                    label155: {
                        Object this$random = this.getRandom();
                        Object other$random = other.getRandom();
                        if (this$random == null) {
                            if (other$random == null) {
                                break label155;
                            }
                        } else if (this$random.equals(other$random)) {
                            break label155;
                        }

                        return false;
                    }

                    Object this$loop = this.getLoop();
                    Object other$loop = other.getLoop();
                    if (this$loop == null) {
                        if (other$loop != null) {
                            return false;
                        }
                    } else if (!this$loop.equals(other$loop)) {
                        return false;
                    }

                    Object this$enabled = this.getEnabled();
                    Object other$enabled = other.getEnabled();
                    if (this$enabled == null) {
                        if (other$enabled != null) {
                            return false;
                        }
                    } else if (!this$enabled.equals(other$enabled)) {
                        return false;
                    }

                    label134: {
                        Object this$overWrite = this.getOverWrite();
                        Object other$overWrite = other.getOverWrite();
                        if (this$overWrite == null) {
                            if (other$overWrite == null) {
                                break label134;
                            }
                        } else if (this$overWrite.equals(other$overWrite)) {
                            break label134;
                        }

                        return false;
                    }

                    label127: {
                        Object this$volume = this.getVolume();
                        Object other$volume = other.getVolume();
                        if (this$volume == null) {
                            if (other$volume == null) {
                                break label127;
                            }
                        } else if (this$volume.equals(other$volume)) {
                            break label127;
                        }

                        return false;
                    }

                    label120: {
                        Object this$pitch = this.getPitch();
                        Object other$pitch = other.getPitch();
                        if (this$pitch == null) {
                            if (other$pitch == null) {
                                break label120;
                            }
                        } else if (this$pitch.equals(other$pitch)) {
                            break label120;
                        }

                        return false;
                    }

                    Object this$areaId = this.getAreaId();
                    Object other$areaId = other.getAreaId();
                    if (this$areaId == null) {
                        if (other$areaId != null) {
                            return false;
                        }
                    } else if (!this$areaId.equals(other$areaId)) {
                        return false;
                    }

                    label106: {
                        Object this$world = this.getWorld();
                        Object other$world = other.getWorld();
                        if (this$world == null) {
                            if (other$world == null) {
                                break label106;
                            }
                        } else if (this$world.equals(other$world)) {
                            break label106;
                        }

                        return false;
                    }

                    Object this$musicId = this.getMusicId();
                    Object other$musicId = other.getMusicId();
                    if (this$musicId == null) {
                        if (other$musicId != null) {
                            return false;
                        }
                    } else if (!this$musicId.equals(other$musicId)) {
                        return false;
                    }

                    label92: {
                        Object this$priority = this.getPriority();
                        Object other$priority = other.getPriority();
                        if (this$priority == null) {
                            if (other$priority == null) {
                                break label92;
                            }
                        } else if (this$priority.equals(other$priority)) {
                            break label92;
                        }

                        return false;
                    }

                    Object this$minPoint = this.getMinPoint();
                    Object other$minPoint = other.getMinPoint();
                    if (this$minPoint == null) {
                        if (other$minPoint != null) {
                            return false;
                        }
                    } else if (!this$minPoint.equals(other$minPoint)) {
                        return false;
                    }

                    Object this$maxPoint = this.getMaxPoint();
                    Object other$maxPoint = other.getMaxPoint();
                    if (this$maxPoint == null) {
                        if (other$maxPoint != null) {
                            return false;
                        }
                    } else if (!this$maxPoint.equals(other$maxPoint)) {
                        return false;
                    }

                    return true;
                }
            }
        }

        protected boolean canEqual(Object other) {
            return other instanceof CreateAreaDto;
        }

        public int hashCode() {
            boolean PRIME = true;
            int result = 1;
            Object $random = this.getRandom();
            result = result * 59 + ($random == null ? 43 : $random.hashCode());
            Object $loop = this.getLoop();
            result = result * 59 + ($loop == null ? 43 : $loop.hashCode());
            Object $enabled = this.getEnabled();
            result = result * 59 + ($enabled == null ? 43 : $enabled.hashCode());
            Object $overWrite = this.getOverWrite();
            result = result * 59 + ($overWrite == null ? 43 : $overWrite.hashCode());
            Object $volume = this.getVolume();
            result = result * 59 + ($volume == null ? 43 : $volume.hashCode());
            Object $pitch = this.getPitch();
            result = result * 59 + ($pitch == null ? 43 : $pitch.hashCode());
            Object $areaId = this.getAreaId();
            result = result * 59 + ($areaId == null ? 43 : $areaId.hashCode());
            Object $world = this.getWorld();
            result = result * 59 + ($world == null ? 43 : $world.hashCode());
            Object $musicId = this.getMusicId();
            result = result * 59 + ($musicId == null ? 43 : $musicId.hashCode());
            Object $priority = this.getPriority();
            result = result * 59 + ($priority == null ? 43 : $priority.hashCode());
            Object $minPoint = this.getMinPoint();
            result = result * 59 + ($minPoint == null ? 43 : $minPoint.hashCode());
            Object $maxPoint = this.getMaxPoint();
            result = result * 59 + ($maxPoint == null ? 43 : $maxPoint.hashCode());
            return result;
        }

        public CreateAreaDto() {
        }

        public CreateAreaDto(String areaId, String world, List<String> musicId, Priority priority, Boolean random, Boolean loop, Boolean enabled, Boolean overWrite, Float volume, Float pitch, AreaDto.Point minPoint, AreaDto.Point maxPoint) {
            this.areaId = areaId;
            this.world = world;
            this.musicId = musicId;
            this.priority = priority;
            this.random = random;
            this.loop = loop;
            this.enabled = enabled;
            this.overWrite = overWrite;
            this.volume = volume;
            this.pitch = pitch;
            this.minPoint = minPoint;
            this.maxPoint = maxPoint;
        }

        public String toString() {
            return "PlayerSelectionCache.CreateAreaDto(areaId=" + this.getAreaId() + ", world=" + this.getWorld() + ", musicId=" + this.getMusicId() + ", priority=" + this.getPriority() + ", random=" + this.getRandom() + ", loop=" + this.getLoop() + ", enabled=" + this.getEnabled() + ", overWrite=" + this.getOverWrite() + ", volume=" + this.getVolume() + ", pitch=" + this.getPitch() + ", minPoint=" + this.getMinPoint() + ", maxPoint=" + this.getMaxPoint() + ")";
        }

        public static class CreateAreaDtoBuilder {
            private String areaId;
            private String world;
            private List<String> musicId;
            private Priority priority;
            private Boolean random;
            private Boolean loop;
            private Boolean enabled;
            private Boolean overWrite;
            private Float volume;
            private Float pitch;
            private AreaDto.Point minPoint;
            private AreaDto.Point maxPoint;

            CreateAreaDtoBuilder() {
            }

            public CreateAreaDto.CreateAreaDtoBuilder areaId(String areaId) {
                this.areaId = areaId;
                return this;
            }

            public CreateAreaDto.CreateAreaDtoBuilder world(String world) {
                this.world = world;
                return this;
            }

            public CreateAreaDto.CreateAreaDtoBuilder musicId(List<String> musicId) {
                this.musicId = musicId;
                return this;
            }

            public CreateAreaDto.CreateAreaDtoBuilder priority(Priority priority) {
                this.priority = priority;
                return this;
            }

            public CreateAreaDto.CreateAreaDtoBuilder random(Boolean random) {
                this.random = random;
                return this;
            }

            public CreateAreaDto.CreateAreaDtoBuilder loop(Boolean loop) {
                this.loop = loop;
                return this;
            }

            public CreateAreaDto.CreateAreaDtoBuilder enabled(Boolean enabled) {
                this.enabled = enabled;
                return this;
            }

            public CreateAreaDto.CreateAreaDtoBuilder overWrite(Boolean overWrite) {
                this.overWrite = overWrite;
                return this;
            }

            public CreateAreaDto.CreateAreaDtoBuilder volume(Float volume) {
                this.volume = volume;
                return this;
            }

            public CreateAreaDto.CreateAreaDtoBuilder pitch(Float pitch) {
                this.pitch = pitch;
                return this;
            }

            public CreateAreaDto.CreateAreaDtoBuilder minPoint(AreaDto.Point minPoint) {
                this.minPoint = minPoint;
                return this;
            }

            public CreateAreaDto.CreateAreaDtoBuilder maxPoint(AreaDto.Point maxPoint) {
                this.maxPoint = maxPoint;
                return this;
            }

            public CreateAreaDto build() {
                return new CreateAreaDto(this.areaId, this.world, this.musicId, this.priority, this.random, this.loop, this.enabled, this.overWrite, this.volume, this.pitch, this.minPoint, this.maxPoint);
            }

            public String toString() {
                return "PlayerSelectionCache.CreateAreaDto.CreateAreaDtoBuilder(areaId=" + this.areaId + ", world=" + this.world + ", musicId=" + this.musicId + ", priority=" + this.priority + ", random=" + this.random + ", loop=" + this.loop + ", enabled=" + this.enabled + ", overWrite=" + this.overWrite + ", volume=" + this.volume + ", pitch=" + this.pitch + ", minPoint=" + this.minPoint + ", maxPoint=" + this.maxPoint + ")";
            }
        }
    }
}
